Repository navigation
2113 nimrod regrid - #2269
2113 nimrod regrid#2269BernardClaxton (BernardClaxton) wants to merge 106 commits into
Conversation
Total coverage: 93% (HTML report)Name Stmts Miss Branch BrPart Cover --------------------------------------------------------------------------------------------------- src/CSET/__init__.py 113 4 14 0 97% src/CSET/_common.py 156 0 54 0 100% src/CSET/cset_workflow/app/fetch_fcst/bin/fetch_data.py 117 28 26 0 78% src/CSET/cset_workflow/app/fetch_nimrod/bin/fetch_nimrod.py 85 8 38 16 80% src/CSET/cset_workflow/app/finish_website/bin/finish_website.py 79 2 8 2 95% src/CSET/cset_workflow/app/parbake_recipes/bin/parbake.py 29 0 8 0 100% src/CSET/cset_workflow/app/send_email/bin/send_email.py 25 0 4 0 100% src/CSET/cset_workflow/lib/python/jinja_utils.py 17 0 6 0 100% src/CSET/extract_workflow.py 105 1 26 1 98% src/CSET/graph.py 44 0 14 0 100% src/CSET/operators/__init__.py 89 0 26 0 100% src/CSET/operators/_atmospheric_constants.py 9 0 0 0 100% src/CSET/operators/_colormaps.py 250 3 72 4 98% src/CSET/operators/_stash_to_lfric.py 3 0 0 0 100% src/CSET/operators/_utils.py 200 8 74 6 95% src/CSET/operators/ageofair.py 142 7 64 5 94% src/CSET/operators/aggregate.py 184 8 60 7 94% src/CSET/operators/aviation.py 61 0 18 0 100% src/CSET/operators/collapse.py 162 8 80 3 94% src/CSET/operators/constraints.py 115 7 50 2 93% src/CSET/operators/convection.py 38 4 10 2 88% src/CSET/operators/ensembles.py 27 0 14 0 100% src/CSET/operators/feature.py 44 0 10 0 100% src/CSET/operators/filters.py 67 2 30 0 98% src/CSET/operators/fluxes.py 41 0 10 0 100% src/CSET/operators/humidity.py 135 0 52 0 100% src/CSET/operators/imageprocessing.py 57 0 16 0 100% src/CSET/operators/mesoscale.py 18 0 2 0 100% src/CSET/operators/misc.py 172 1 72 3 98% src/CSET/operators/plot.py 1174 156 440 71 83% src/CSET/operators/power_spectrum.py 156 10 60 8 91% src/CSET/operators/precipitation.py 204 2 92 2 99% src/CSET/operators/pressure.py 41 0 12 0 100% src/CSET/operators/radar_filter.py 111 4 44 4 95% src/CSET/operators/read.py 453 25 200 15 94% src/CSET/operators/regrid.py 147 1 70 3 98% src/CSET/operators/scoreswrappers.py 226 22 74 6 89% src/CSET/operators/temperature.py 121 0 32 0 100% src/CSET/operators/transect.py 63 0 24 0 100% src/CSET/operators/wind.py 46 3 10 2 91% src/CSET/operators/write.py 15 0 6 0 100% src/CSET/recipes/__init__.py 104 0 28 0 100% src/CSET/sample_data/__init__.py 0 0 0 0 100% --------------------------------------------------------------------------------------------------- TOTAL 5445 314 1950 162 93% |
…, np.nanmax, np.nanmean #2113
60bea6d to
4b81b55
Compare
| title=Produce Nimrod 2D surface plots | ||
| description=Produce 2D surface plots of radar observations. | ||
| help=Switch to produce 2D surface plots utilising Nimrod radar observations. | ||
| Plots are produced of the 2D surface rainfall for each of the selected Nimrod sources. |
There was a problem hiding this comment.
more precision needed: Nimrod provides rainfall amounts
| title=Produce Nimrod radar histograms | ||
| description=Produce histograms incorporating radar observations. | ||
| help=Switch to produce histograms utilising Nimrod radar observations. | ||
| The histograms will combine both model rainfall and radar observations. |
There was a problem hiding this comment.
This will likely change when lfric gives us accumulations as well, but worth being precise her that Nimrod gives as amounts as an accumulation for sum products and a 5min "snapshot" for the other product, whereas the models currently gives us rainfall_rate i.e. amount per time as a snapshot
| def select_radar_source(input_source_list): | ||
| """Select the preferred radar source from a list of sources.""" | ||
| # Preference list for Nimrod sources, with most preferred heading the list. | ||
| nimrod_preference = ["Nimrod2km", "Nimrodxkm", "Nimrod1km"] |
There was a problem hiding this comment.
needs explanation for xkm
| # for this is set in v["weights"]. | ||
| if v["weights"] == "True" and nimrod_weights_exist == "True": | ||
| filename_wei_nc = ( | ||
| f"{nimrod_dir_wei}/{date_use.strftime('%Y%m%d%H%M')}" |
There was a problem hiding this comment.
Now the radar data are written out with a timepoint in the filename that is shifted by 1hour for the radar_offset. So a file with CYCLE_POINT timestamp in the name is now renamed to CYCLE_POINT+1 in the name while the time coordinates inside have not changed. Is this correct given that the original filename has the endtime in the filename?
There was a problem hiding this comment.
Need to check the filenames written to disk: Do we now have CYCLE_POINT+1 as filename, but time bounds in the file with [CYCLE_POINT-1:CYCLE_POINT]?
Carol Halliwell (cehalliwell)
left a comment
There was a problem hiding this comment.
I have has a look through and left comments/suggestions.
Could you add a description of what this PR is doing?
Have you tested all the different combinations (or as many as possible) of radar type/model?
| ] | ||
|
|
||
| # Specify the boundary margin width to use when trimming model fields. | ||
| boundary_margin = 16 |
There was a problem hiding this comment.
Does this need to be fixed? If not, can it be set by the user?
| description=Produce histograms incorporating radar observations. | ||
| help=Switch to produce histograms utilising Nimrod radar observations. | ||
| The histograms will combine both model rainfall and radar observations. | ||
| The model rainfall variable is selected in the Rose tab Diagnostics/Surface (2D) fields. |
There was a problem hiding this comment.
Is this correct? Other code suggests rainfall variable is fixed, i.e.
"MODEL_VARNAME": "surface_microphysical_rainfall_rate",
|
do the recipes maybe belong in their own directory now? e.g recipes/radar or recipes/surface_fields/radar? |
Co-authored-by: Sylvia Bohnenstengel <62748926+Sylviabohnenstengel@users.noreply.github.com>
Co-authored-by: Sylvia Bohnenstengel <62748926+Sylviabohnenstengel@users.noreply.github.com>
Co-authored-by: Sylvia Bohnenstengel <62748926+Sylviabohnenstengel@users.noreply.github.com>
…plot.yaml Co-authored-by: Carol Halliwell <150140850+cehalliwell@users.noreply.github.com>
…togram_domain_mean.yaml Co-authored-by: Carol Halliwell <150140850+cehalliwell@users.noreply.github.com>
…togram_sequence.yaml Co-authored-by: Carol Halliwell <150140850+cehalliwell@users.noreply.github.com>
|
I have started to make some changes in this branch, some thing I'm not too sure about though. |
|
I've been doing some testing with this branch on Sana's sensitivity experiments over the UK. I had to change the recipe arguments of The spatial maps of radar seem to work. Model comparisons don't seem to work. Errors I get include;
|
| if nimrod_field == "Nimrod_comp_xkm": | ||
| radar_offset = timedelta(hours=1.0) | ||
| if nimrod_field == "Nimrod_comp_1km": | ||
| radar_offset = timedelta(hours=1.0) | ||
| if nimrod_field == "Nimrod_comp_2km": | ||
| radar_offset = timedelta(hours=1.0) |
There was a problem hiding this comment.
could do this witth a Match Case statement too and I feel it's a bit cleaner.
Contribution checklist
Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.
Githib copilot was used to help write some of the tests in test_radar_filter.py.